package com.cainaer.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cainaer.member.domain.Member;
import com.cainaer.member.domain.vo.MemberVo;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 会员登录表 Mapper 接口
 * </p>
 *
 * @author Tina
 * @since 2020-08-22
 */
public interface MemberMapper extends BaseMapper<Member> {

    /**
     * 根据条件分页查询会员列表
     *
     * @param member
     * @return
     */
    IPage<Member> queryMemberInfo(Page<Member> page, Member member);

    @Select("select  member.member_img as memberImg, member_info.nick_name as nickName from member left join member_info on member.member_id=member_info.member_id where member.member_id=#{memberId}")
    public MemberVo selectMemberById(Integer memberId);
}
